#include <iostream>
#include <string>

using namespace std;

/*
析构顺序
    先析构 子对象
    再析构 父对象
*/

class person
{
public:
    int A;
protected:
    int B;
private:
    int C;
public:
    person()
    {
        cout << "基类 空 构造" << endl;
    }
    person(int A,int B,int C):A(A),B(B),C(C)
    {
        cout << "基类 有参 构造" << endl;
    }
    ~person(){
        cout << "基类 析构" << endl;
    }

    void set_C(int c)
    {
        this->C = c;
    }
};

class student : private person
{
public:
    int D;
    int E;
public:
    student()
    {
        cout << "派生类 空 构造" << endl;
    }
    student(int A,int B,int C,int D,int E):person(A,B,C),D(D),E(E)
    {
        cout << "派生类 有参 构造" << endl;
    }
    ~student(){
        cout << "派生类 析构" << endl;
    }
};

int main(int argc, char const *argv[])
{
    student s1;
    
    return 0;
}
